var timerId = null

//开启循环
function start() {
  if (timerId) {
    return
  }
  timerId = setInterval(function () {

    console.clear()
    console.log(new Date().toLocaleString());

  }, 1000)
}


//结束定时
function end() {
  clearInterval(timerId)
  timerId = null
}